projects
/
nextcloud-desktop.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38f1d05
)
Fix index check
author
Fredrik Eriksson
<feffe@fulh.ax>
Thu, 2 Jan 2025 13:46:32 +0000
(14:46 +0100)
committer
Matthieu Gallien
<matthieu.gallien@nextcloud.com>
Fri, 3 Jan 2025 13:46:33 +0000
(14:46 +0100)
Also fixes handling of empty netrc.
Signed-off-by: Fredrik Eriksson <feffe@fulh.ax>
src/cmd/netrcparser.cpp
patch
|
blob
|
history
diff --git
a/src/cmd/netrcparser.cpp
b/src/cmd/netrcparser.cpp
index 15417e13438830c2c87df82fb749ae2fadbb9c9f..f9b95c762f614d480a2cc31953814a50ecbf1613 100644
(file)
--- a/
src/cmd/netrcparser.cpp
+++ b/
src/cmd/netrcparser.cpp
@@
-56,6
+56,9
@@
bool NetrcParser::parse()
return false;
}
QString content = netrc.readAll();
+ if (content.isEmpty()) {
+ return false;
+ }
auto tokens = content.split(QRegularExpression("\\s+"));
@@
-71,9
+74,9
@@
bool NetrcParser::parse()
}
i++;
- if (i > tokens.count()) {
+ if (i >
=
tokens.count()) {
qDebug() << "error fetching value for" << key;
-
return false
;
+
break
;
}
auto value = tokens[i];